<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>房来房网</title>
    <link href="../../vendors/iview/css/iview.css" rel="stylesheet" />
    <link href="../../styles/common.css" rel="stylesheet" >
    <link href="../../styles/home.css" rel="stylesheet" >
    <link href="../../styles/modalStyle.css" rel="stylesheet" />
    <link href="../../styles/company.css" rel="stylesheet" />
    <link href="components/css/shiftCustomerToOtherStaff.css" rel="stylesheet" />
    <link href="components/css/customerAdd.css" rel="stylesheet" />
    <link href="components/css/customerEdit.css"  rel="stylesheet" />
    <link href="components/css/customerDetail.css" rel="stylesheet" />
    <link href="../visit-manage/visit-record/components/css/addVisitRecord.css" rel="stylesheet" />
    <link href="components/css/customerSearchOfDept.css" rel="stylesheet" />
    <link href="../visit-manage/visit-record/components/css/visitRecord.css" rel="stylesheet" />
    <link href="../visit-manage/visit-record/components/css/lookedHouseList.css" rel="stylesheet" />
    <link href="components/css/contactAdd.css" rel="stylesheet" />
    <link href="components/css/contactEdit.css" rel="stylesheet" />
    <link href="components/css/contactList.css" rel="stylesheet" />
    <link href="components/css/contactInfo.css" rel="stylesheet" />
    <link href="components/css/InputContact.css" rel="stylesheet" />
    <link href="../visit-manage/visit-record/components/css/stopTrack.css" rel="stylesheet" />
    <link href="../../styles/quilleditor.css" rel="stylesheet" />
    <link href="../../vendors/quill/vue-quill-editor.css" rel="stylesheet" />

</head>
<body>
<!--我的客户内容自适应-->
<div class="company" style="overflow:hidden;" id="deptPool">
    <div class="company-box">
        <!--我的客户查询条件-->
        <customer-search ref="customerSearch" v-bind:pool-type="poolType"></customer-search>
        <!--我的客户查询结果列表  concluded-list-->
        <div class="company-two">
            <div class="c-two-left">
                <!--列表顶部操作按钮-->
                <div class="c-two-top" id="section-bomb-box" v-cloak>
                    <dl>
                        <dd type="primary" v-on:click="showCustomerAdd" class="AddClient"><i></i>添加客户</dd>

                        <dd type="primary" v-on:click="clickShiftCustomerToDept" class="modalAscription"><i></i>转移客户归属</dd>

                        <dd type="primary" v-on:click="clickShiftCustomerToStaff" class="turn"><i></i>转为个人客户</dd>

                        <dd type="primary" size="large" v-on:click="exportData" class="export"><i></i>导出Excel</dd>
                    </dl>
                    <div class="c-sort">
                        <strong class="state-input">
                            <i-select v-model="defaultSort" placeholder="默认排序" v-on:on-change="changeSort">
                                <i-option v-for="item in sortOption" :value="item.value" :key="item">
                                    {{ item.label }}
                                </i-option>
                            </i-select>
                        </strong>
                    </div>
                </div>
                <!--数据表-->
                <customer-list show-type="deptOrCompanyCustomer" div-layout='false' ref="customerList"></customer-list>
                <!--数据分页-->
                <paging ref="paging" v-bind:page-rows="pageSize" current-page="1"></paging>
            </div>
        </div>
    </div>

    <!--弹出框modal_Begin-->
    <!--客户详情弹框_Begin-->
    <customer-detail ref="customerDetail" v-bind:pool-type="poolType"></customer-detail>
    <!--客户详情弹框_End-->
    <!--新增客源弹框begin-->
    <customer-add pool="部门池" ref="customerAdd"></customer-add>
    <!--新增客源弹框结束end-->
    <!--确认放入私客池begin-->
    <shift-customer-to-staff ref="shiftToStaff"></shift-customer-to-staff>
    <!--确认放入公客池end-->
    <!--转移客户begin-->
    <shift-customer-to-other-dept ref="customerShif" v-bind:pool-type="poolType"></shift-customer-to-other-dept>
    <!--转移客户end-->

    <!--断开跟踪begin-->
    <stop-track ref="stopTrack"></stop-track>
    <!--断开跟踪end-->
</div>

<script src="../../vendors/require.js"></script>


<!--&lt;!&ndash;多窗口的js开始&ndash;&gt;-->
<!--<script src="../../vendors/jquery.metisMenu.js"></script>-->
<!--<script src="../../vendors/jquery.slimscroll.min.js"></script>-->
<!--<script src="../../vendors/contabs.min.js" type="text/javascript"></script>-->
<!--<script src="../../data/AdministrativeDivisionOptionContainSelf.js"></script>-->
<!--<script src="../../data/AdministrativeDivisionOption.js"></script>-->

<!--&lt;!&ndash;自定义样式&ndash;&gt;-->
<!--<script src="../../vendors/custom.js"></script>-->
<!--&lt;!&ndash;分页&ndash;&gt;-->
<!--<script src="../../vendors/jpage.js"></script>-->
<!--&lt;!&ndash;拖拽弹框&ndash;&gt;-->
<!--<script src="../../vendors/draggable.js"></script>-->

<script>
    require.config({
        paths: {
            'jquery': '../../vendors/jquery-3.2.1.min',
            'vue': '../../vendors/vue/vue.min',
            'iview': '../../vendors/iview/js/iview',
            'quill': '../../vendors/quill/vue-quill-editor.min',
            'reg': '../../common/utils/RegularExpression',
            'api': '../../api/api-config',
            'custom': '../../vendors/custom',
            'AdministrativeDivisionOption':'../../data/AdministrativeDivisionOption',
            'AdministrativeDivisionOptionContainSelf':'../../data/AdministrativeDivisionOptionContainSelf',
            'draggable':'../../vendors/draggable',
            'CryptoJS':'../../vendors/crypto-js',

            'CustomerSearchOfDept': './components/js/CustomerSearchOfDept',
            'CustomerAdd': './components/js/CustomerAdd',
            'ShiftCustomerToOtherDept': './components/js/ShiftCustomerToOtherDept',
            'ShiftCustomerToStaff': './components/js/ShiftCustomerToStaff',
            'StopTrack': '../visit-manage/visit-record/components/js/StopTrack',
            'AddVisitRecord': '../visit-manage/visit-record/components/js/AddVisitRecord',
            'VisitRecordInfo': '../visit-manage/visit-record/components/js/VisitRecordInfo',
            'VisitRecord': '../visit-manage/visit-record/components/js/VisitRecord',
            'LookedHouseList': '../visit-manage/visit-record/components/js/LookedHouseList',
            'TradedList': '../visit-manage/visit-record/components/js/TradedList',

            'InputContact': './components/js/InputContact',
            'ShowContact': './components/js/ShowContact',
            'ContactAdd': './components/js/ContactAdd',
            'ContactEdit': './components/js/ContactEdit',
            'ContactInfo': './components/js/ContactInfo',
            'ContactList': './components/js/ContactList',

            'CustomerInfo': './components/js/CustomerInfo',
            'CustomerEdit': './components/js/CustomerEdit',
            'CustomerDetail': './components/js/CustomerDetail',
            'CustomerList': './components/js/CustomerList',
            'Paging': '../../components/paging/Paging',
        }
    });

    require(['jquery','vue', 'quill', 'iview','CustomerAdd','ShiftCustomerToOtherDept','CustomerDetail',
            'CustomerList','CustomerSearchOfDept','Paging','ShiftCustomerToStaff','StopTrack','custom','draggable'],
        function ($,Vue, VueQuillEditor, iview,CustomerAdd,ShiftCustomerToOtherDept,CustomerDetail,CustomerList,
                  CustomerSearchOfDept,Paging,ShiftCustomerToStaff,StopTrack, custom,Draggable) {
            Vue.use(iview);
            Vue.use(VueQuillEditor);
            window.bus = new Vue();
            var vmPool = new Vue({
                el: "#deptPool",
                data: {
                    poolType: "DeptPool",
                    showType: "deptOrCompanyCustomer",
                    pageSize: 15,

                    /*默认排序*/
                    sortOption: [
                        {
                            value: 'CreatedTime,false',
                            label: '创建时间倒序',
                        },
                        {
                            value: 'AddTime,true',
                            label: '录入时间顺序'
                        },
                        {
                            value: 'AddTime,false',
                            label: '录入时间倒序'
                        },
                        {
                            value: 'Name,true',
                            label: '客户姓名顺序'
                        }
                    ],
                    defaultSort: "CreatedTime,false",
                },
                components: {
                    CustomerAdd: CustomerAdd,
                    ShiftCustomerToOtherDept: ShiftCustomerToOtherDept,
                    CustomerDetail: CustomerDetail,
                    CustomerList: CustomerList,
                    CustomerSearch: CustomerSearchOfDept,
                    paging: Paging,
                    'shift-customer-to-staff': ShiftCustomerToStaff,
                    'stop-track': StopTrack,
                },
                mounted: function () {
                    //触发search
                    window.bus.$emit("search", true);
                    this.$nextTick(function () {
                        custom();
                    });
                },
                created: function () {
                    var thisPool = this;

                },
                methods: {
                    showCustomerAdd() {
                        //触发showCustomerAdd
                        window.bus.$emit("showCustomerAdd");
                    },
                    clickShiftCustomerToDept() {
                        //触发clickShiftCustomerToOtherDept
                        window.bus.$emit("clickShiftCustomerToOtherDept");
                    },
                    clickShiftCustomerToStaff() {
                        //触发clickShiftCustomerToStaff
                        window.bus.$emit("clickShiftCustomerToStaff");
                    },
                    changeSort: function (value) {
                        //触发search
                        window.bus.$emit("changeSort", this.defaultSort);
                    },
                    exportData: function () {
                        //触发exportData
                        window.bus.$emit("exportData");
                    }
                }
            });


            $(function () {
                $("body").keyup(function (e) {
                    if (vmPool && vmPool.$refs.customerDetail.isFocus) {
                        vmPool.$refs.customerDetail.keyUp(e);
                    }
                });
                document.addEventListener("keydown", press, false);
                function press(i) {
                    if (i.keyCode == 116) { //F5 -
                        i.preventDefault();
                        location.reload(true);
                    }
                }
            });

            new Draggable('.leftInfo-header', {
                parentMove: '.message-box',
            });
        });

</script>

</body>
</html>
